package mybatis_learn.mapper;

import mybatis_learn.pojo.Car;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CarMapper {
    int insertCar(Car car);
    Car SelectById(Long id);
    int UpdateById(Car car);
    int DeleteById(Long id);
    List<Car> SelectAll();
    //if标签
    List<Car> SelectByMutilCondition(@Param("brand")String brand,
                                     @Param("guidePrice") Double guidePrice,
                                     @Param("carType") String carType);
    //where标签
    List<Car> SelectByMutilCondition2(@Param("brand")String brand,
                                     @Param("guidePrice") Double guidePrice,
                                     @Param("carType") String carType);
    //trim标签
    List<Car> SelectByMutilCondition3(@Param("brand")String brand,
                                      @Param("guidePrice") Double guidePrice,
                                      @Param("carType") String carType);
    //set标签
    int updateset(Car car);

    //choose when  otherwise
    List<Car> SelectByMutilCondition4(@Param("brand") String brand,
                                      @Param("guidePrice") Double guidePrice,
                                      @Param("carType") String carType);
    //foreach
    //批量删除1
    int deleteByIds(@Param("ids") String[] ids);
    //批量删除2 采用or删除
    int deleteByIds2(@Param("ids2") String[] ids1);
    //批量插入
    int insertBatch(@Param("cars") List<Car> cars);


}
